package com.system.employee.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.system.employee.entity.Employee;
import com.system.user.entity.User;




@org.springframework.stereotype.Repository
public interface EmployeeRepository extends PagingAndSortingRepository<Employee, Long>,JpaSpecificationExecutor<Employee>{
	public Employee findEmployeeByUser(User user);
	public Employee findEmployeeByEmpName(String empName);
	public List<Employee> findEmployeeByEmpNameLike(String empName);
//	@Query("from Employee e join e.post p where p.postName like :postName")
//	public Employee findEmployeeByPostName(@Param("postName")String postName);
//	@Query("select e from Employee e join e.post ps join ps.part.pr where pr.partId=:partId And ps.postName like '%部长%'" )
//	public List<Employee> findEmployee(@Param("partId")Long partId);
	@Query("from Employee employee")
	public List<Employee> findAll();
}
